//
//  DDSetTheController.m
//  DDMusic
//
//  Created by 何星宏 on 2016/11/13.
//  Copyright © 2016年 FengBaoFamily. All rights reserved.
//

#import "DDSetTheController.h"
#import "DDSetTheCell.h"

@interface DDSetTheController ()

@end

@implementation DDSetTheController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    
    self.tableView.rowHeight = 80;
    
}

//设置组数
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
    return 3;
}

//设置行数
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    
    return 1;
}



//设置组头高度
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
    
    return 60;
}

- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{
    return 10;
}

//组头标题
- (NSString*)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section{
    switch (section) {
        case 0:
            return @"个人资料";
            break;
            case 1:
            return @"关于我们";
            break;
            
        default:
            return @"意见反馈";
            break;
    }
}



- (UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    DDSetTheCell* cell = [[NSBundle mainBundle]loadNibNamed:@"DDSetTheCell" owner:nil options:nil].firstObject;
    switch (indexPath.section) {
        case 1:
            [cell.HeadImage setHidden:YES];
            [cell.nickname setHidden:YES];
            [cell.LevelImage setHidden:YES];
            [cell.levelLabel setHidden:YES];
            cell.textLabel.text = @"关于我们";
            break;
            case 2:
            [cell.HeadImage setHidden:YES];
            [cell.nickname setHidden:YES];
            [cell.LevelImage setHidden:YES];
            [cell.levelLabel setHidden:YES];
            cell.textLabel.text = @"意见反馈";
            break;
        default:
            
            break;
    }
    
    
    return cell;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    switch (indexPath.section) {
        case 0:
            NSLog(@"个人信息");
            break;
            case 1:
            NSLog(@"关于我们");
            break;
        default:
            NSLog(@"意见反馈");
            break;
    }

}



@end
